n = input()
nums = list(map(int, input().split()))
print(max(nums))
print(min(nums))
print(sum(nums))
